<template>
    <div class="template-index-Lu">
        <commpVxeTable
            :isCanWrap="true"
            :searchType="true"
            :key="reCommpVxeTable"
            :conditionBtnRow="true"
            :config="dataTableConfig"
            :columns="columnsVxe"
            :formItem="formItem"
            @checkboxChange="checkboxChange"
            ref="administrativeOffice"
            @searchEvent="searchEvent"
            @resetEvent="resetEvent"
            >
            <!-- <template v-slot:externalOperations="{data}"  >
                <vxe-form-item>
                    <template>
                        <a-button class="blue-btn" @click="" icon="reload">新增回访任务</a-button>
                    </template>
                </vxe-form-item>
            </template> -->
            <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                <a-form layout="inline">
                    <a-form-item>
                        <a-button class="green-btn" @click="reviseClick(row)" icon="eye">查看</a-button>
                    </a-form-item>
                </a-form>
            </template>
        </commpVxeTable>
        <increase ref="refModel"/>
    </div>
</template>
<script>
import  assessCheckApi  from './service/api.js'
import {} from './service/index'
import  commpVxeTable   from '@/components/commp-vxe-table/commp-vxe-table.vue'
import increase from './increase.vue'
export default {
    components: {
        commpVxeTable,
        increase,
    },
    props:{
    },
    data() {
        return {
            reCommpVxeTable: '',
            dataTableConfig: {
                api: assessCheckApi.querySqsxYysPageList,
                rowId: 'id',
                paramet: {}
            },
            columnsVxe: [
                {
                    type: 'checkbox',
                    width: 60,
                    fixed: 'left'
                },{
                    title: '企业名称',
                    field: 'fyyrq',
                },{
                    title: '企业地址',
                    field: 'fyyrq',
                },{
                    title: '核查状态',
                    field: 'ftjzt',
                    // width: 100,
                },{
                    title: '所属科室',
                    field: 'fclzt',
                    // width: 100,
                },{
                    title: '回访状态',
                    field: 'fjhlfrs',
                },{
                    title: '接收时间',
                    field: 'fsftgsh',
                    slots: {
                    // 使用插槽模板渲染
                        default: 'operation_fsftgsh',
                    },
                },
                // {
                //     title: '操作',
                //     field: 'id',
                //     width: 100,
                //     titleInterval:true,
                //     slots: {
                //     // 使用插槽模板渲染
                //         header:'data1_header',
                //         default: 'operation_btn',
                //     },
                // }
            ],
            formItem: [
                {
                    label: '关键字',
                    model: 'gjz',
                },{
                    label: '核查状态',
                    model: 'fclscms',
                    type:'Select',
                    options:[{value:'需要技术审评',label:'需要技术审评'},{value:'免于技术审评',label:'免于技术审评'}],
                    searchType:'收起',
                },{
                    label: '所属科室',
                    model: 'fywflname',
                    searchType:'收起',
                    type:'Select',
                    dictionaryType:'查验流程所属科室'
                },{
                    label: '接收时间',
                    model: ['slkssj','sljssj'],
                    type: 'rangePicker',
                    format: 'YYYY-MM-DD',
                    searchType:'收起',
                },{
                    label: '回访状态',
                    model: 'fhfzt',
                    type:'Select',
                    options:[{value:'未回访',label:'未回访'},{value:'回访中',label:'回访中'},{value:'已回访',label:'已回访'}],
                    searchType:'收起',
                },
            ],
            jobidList: [],
            checkList: [],
            formData: {},
            opinion: '',
            reJobid: '',
        }
    },
    methods: {
        // 勾选
        checkboxChange(val){
            //console.log('已选择',val)
            this.jobidList = []
            this.checkList = []
            this.checkList = val
            if(val.length){
                val.forEach(item => {
                    this.jobidList.push(item.jobid)
                });
            }
        },
        // 搜索
        searchEvent(){
            this.dataTableConfig.paramet = {
                ...this.dataTableConfig.paramet,
            }
            //console.log(this.dataTableConfig.paramet)
        },
        // 重置
        resetEvent(){
            this.dataTableConfig.paramet = {
                ...this.dataTableConfig.paramet,
            }
        },
        // 查看
        reviseClick(row){
            this.$refs.refModel.applicationFormVisible = true
            this.$refs.refModel.getData(row.id)
        },
        // 弹窗提交成功
        success(){
            // 刷新表格 清空id数组
            this.$refs.administrativeOffice.resetEvent()
            this.jobidList = []
        },
    },
}
</script>
